<!--
 * @Description: 
 * @Author: 橘子味的心
 * @Date: 2020-11-13 22:30:58
 * @LastEditTime: 2021-04-08 11:25:21
 * @LastEditors: 橘子味的心
 * @Reference: 
-->
<html>

<head>
    <meta charset="utf-8">
    <title>{$web.title}</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="{$assets}/layui/css/layui.css">
    <link rel="stylesheet" href="/{$route_prefix}/assets/json-viewer.min.css">
    <link rel="stylesheet" href="/{$route_prefix}/assets/style.min.css">
    {block name="head"}
    {/block}
</head>

<body style="display: none;">
    <div class="layui-layout mier-apidoc-admin">
        {block name="header"}
        <div class="layui-header">
            <div class="mier-main">
                <div class="layui-logo">
                    <img src="/{$route_prefix}/assets/logo.png" alt="{$web.title}">
                </div>
                <ul class="layui-layout-left layui-form component">
                    <li class="layui-nav-item">
                        <select lay-search="" lay-filter="component">
                            <option value="">搜索接口或选择模块</option>
                            {if(isset($document))}
                            <option value="" disabled>序言</option>
                            {volist name="document" id='v'}
                            <option value="/{$route_prefix}/document?name={$key}" {input('name')==$key ? 'selected' : ''
                                }>
                                ├──{$v.name}</option>
                            {/volist}
                            {/if}
                            {volist name='menu' id='v'}
                            <option value="/{$route_prefix}/module?name={$v.class}" <?php echo
                                (input('name')==$v['class']) ? 'selected' : '' ; ?>>{$v.title}</option>
                            {if(isset($v.action))}
                            {volist name='v.action' id='m'}
                            <option value="/{$route_prefix}/action?name={$m.href}" <?php echo
                                (input('name')==$m['href']) ? 'selected' : '' ; ?>>├──{$m.title}</option>
                            {/volist}
                            {/if}
                            {/volist}
                        </select>
                    </li>
                </ul>
                <ul class="layui-nav layui-layout-right">
                    <li class="layui-nav-item" id="main-full"><a href="javascript:;">全屏</a></li>
                    <li class="layui-nav-item"><a href="/{$route_prefix}">文档</a></li>
                    <li class="layui-nav-item"><a href="/{$route_prefix}/outlogin">退出</a></li>
                </ul>
            </div>
        </div>
        {/block}
        {block name="main"}
        <div class="layui-main site-inline">
            <div class="mier-site-tree">
                {include file="left" /}
            </div>
            <div class="site-content">
                {block name="content"}{/block}
            </div>
        </div>
        {/block}
        <div class="site-tree-mobile layui-hide">
            <i class="layui-icon layui-icon-right"></i>
        </div>
        <div class="site-mobile-shade"></div>
        {block name="footer"}
        <!-- {/*include file="footer"?* /} -->
        {/block}
    </div>
    <script src="{$assets}/layui/layui.js"></script>
    <script src="/{$route_prefix}/assets/json-viewer.min.js"></script>
    <script src="/{$route_prefix}/assets/clipboard.min.js"></script>
    <script>
        document.onreadystatechange = function () {
            if (document.readyState == "complete") {
                document.body.style.display = "block";
            } else {
                document.body.style.display = "none";
            };
        };
    </script>
    <script>
        layui.use(['element', 'form'], function () {
            var element = layui.element,
                $ = layui.jquery,
                form = layui.form;
            form.on('select(component)', function (item) {
                window.location.href = item.value;
            });
            $('.site-tree-mobile').click(function (e) {
                $('body').addClass("site-mobile");
            });
            $('.site-mobile-shade').click(function (e) {
                $('body').removeClass("site-mobile");
            });
            if (layui.sessionData('main').full) {
                $(document).ready(function () {
                    full();
                });
            }
            $('#main-full').click(function (e) {
                if ($('.layui-main').hasClass('main-full')) {
                    t_full();
                } else {
                    full();
                }
            });
            function t_full() {
                $('.layui-main').removeClass("main-full");
                $('.mier-main').removeClass("main-full");
                $('#main-full').find('a').text('全屏');
                layui.sessionData('main', {
                    key: 'full'
                    , value: false
                });
            }
            function full() {
                $('.layui-main').addClass("main-full");
                $('.mier-main').addClass("main-full");
                $('#main-full').find('a').text('退出全屏');
                layui.sessionData('main', {
                    key: 'full'
                    , value: true
                });
            }
            //显示当前tab
            if (location.hash) {
                element.tabChange('doc', location.hash.replace(/^#/, ''));
            }
            element.on('tab(doc)', function () {
                var othis = $(this),
                    layid = othis.attr('lay-id');
                if (layid) {
                    location.hash = layid;
                }
            });
            form.on('select(tabVersion)', function (e) {
                window.location.href = "/{$route_prefix}/document?name=explain&version=" + e.value
            });
        });
    </script>
    {block name='js'} {/block}
</body>

</html>